﻿using PARK.Common.Const;
using SqlSugar;
using System;

namespace PARK.Consumer.Entity
{
    /// <summary>
    /// 食谱菜单服务
    /// </summary>
    [SugarTable("consum_menus")]
    [Tenant(ClaimConst.TENANT_ID)]
    public class ConsumMenusEntity
    {
        /// <summary>
        /// Id
        /// </summary>
        [SugarColumn(ColumnName = "Id", IsPrimaryKey = true)]
        public string Id { get; set; }

        /// <summary>
        /// 餐段Id
        /// </summary>
        [SugarColumn(ColumnName = "TimeIntervalId")]
        public string TimeIntervalId { get; set; }
        /// <summary>
        /// 餐段名称
        /// </summary>
        [SugarColumn(ColumnName = "TimeIntervalName")]
        public string TimeIntervalName { get; set; }

        /// <summary>
        /// 周一
        /// </summary>
        [SugarColumn(ColumnName = "Week1")]
        public string Week1 { get; set; }

        /// <summary>
        /// 周二
        /// </summary>
        [SugarColumn(ColumnName = "Week2")]
        public string Week2 { get; set; }

        /// <summary>
        /// 周三
        /// </summary>
        [SugarColumn(ColumnName = "Week3")]
        public string Week3 { get; set; }

        /// <summary>
        /// 周四
        /// </summary>
        [SugarColumn(ColumnName = "Week4")]
        public string Week4 { get; set; }

        /// <summary>
        /// 周五
        /// </summary>
        [SugarColumn(ColumnName = "Week5")]
        public string Week5 { get; set; }

        /// <summary>
        /// 周六
        /// </summary>
        [SugarColumn(ColumnName = "Week6")]
        public string Week6 { get; set; }

        /// <summary>
        /// 周天
        /// </summary>
        [SugarColumn(ColumnName = "Week7")]
        public string Week7 { get; set; }

        /// <summary>
        /// 
        /// </summary>
        [SugarColumn(ColumnName = "SortCode")]
        public int? SortCode { get; set; }

        /// <summary>
        /// LastModifyUserId
        /// </summary>
        [SugarColumn(ColumnName = "LastModifyUserId")]
        public string LastModifyUserId { get; set; }

        /// <summary>
        /// LastModifyUserName
        /// </summary>
        [SugarColumn(ColumnName = "LastModifyUserName")]
        public string LastModifyUserName { get; set; }

        /// <summary>
        /// LastModifyTime
        /// </summary>
        [SugarColumn(ColumnName = "LastModifyTime")]
        public DateTime? LastModifyTime { get; set; }

        /// <summary>
        /// 所属公司Id
        /// </summary>
        [SugarColumn(ColumnName = "CompanyId")]
        public string CompanyId { get; set; }

        /// <summary>
        /// 公司名称
        /// </summary>
        [SugarColumn(ColumnName = "CompanyName")]
        public string CompanyName { get; set; }

        /// <summary>
        /// 修改
        /// </summary>
        public virtual void LastModify(string Id)
        {
            this.Id = Id;
            var userId = App.User.FindFirst(ClaimConst.CLAINM_USERID)?.Value;
            var userName = App.User.FindFirst(ClaimConst.CLAINM_REALNAME)?.Value;
            this.LastModifyTime = DateTime.Now;
            if (!string.IsNullOrEmpty(userId))
            {
                this.LastModifyUserId = userId;
                this.LastModifyUserName = userName;
            }
        }
        

    }
}
